<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 韩金龙
  Date: 2021/11/29
  Time: 9:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-1.8.2.min.js"></script>
    <link rel="stylesheet" href="css/css.css">
    <link rel="stylesheet" href="css/imh.css">
</head>
<body>
    欢迎tom登录
    <form action="list.do" method="post">
        <input type="hidden" name="pageNum">
        制图文件:<input type="text" name="pic" value="${map.pic}">
        制作人:<input type="text" name="name" value="${map.name}">
        审核人:<input type="text" name="names" value="${map.names}">
        <br>
        版本号:<input type="text" name="bbidMin" value="${map.bbidMin}" >-
        <input type="text" name="bbidMax" value="${map.bbidMax}">
        从版本号:<input type="text" name="cbbidMin" value="${map.cbbidMin}" >-
        <input type="text" name="cbbidMax" value="${map.cbbidMax}">
        <br>
        时间:<input type="text" name="timeMin" value="${map.timeMin}" >-
        <input type="text" name="timeMax" value="${map.timeMax}">
        <input type="submit" value="搜索">
    </form>
    <table>
        <tr>
            <td>编号</td>
            <td>时间</td>
            <td>品牌</td>
            <td>品类</td>
            <td>版本号</td>
            <td>从版本号</td>
            <td>图片</td>
            <td>总用量</td>
            <td>制作人</td>
            <td>审核人</td>
            <td>备注</td>
            <td>操作</td>
        </tr>
        <c:forEach items="${pageInfo.list}" var="li">
            <tr>
                <td>${li.sid}</td>
                <td>${li.time}</td>
                <td>${li.pp}</td>
                <td>${li.type}</td>
                <td>${li.bbid}</td>
                <td>${li.cbbid}</td>
                <td>
                    <img src="${li.pic}" alt="无法显示" width="50px">
                </td>
                <td>${li.sums}</td>
                <td>${li.name}</td>
                <td>${li.names}</td>
                <td>${li.oder}</td>
                <td>
                    <button onclick="addTo()">添加</button>
                </td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="20">
                <button onclick="fy(1)">首页</button>
                <button onclick="fy(${pageInfo.isFirstPage?1:pageInfo.prePage})">下页</button>
                <button onclick="fy(${pageInfo.isLastPage?pageInfo.pages:pageInfo.nextPage})">上页</button>
                <button onclick="fy(${pageInfo.pages})">尾页</button>
                第${pageInfo.pageNum}/${pageInfo.pages}页
            </td>
        </tr>
    </table>
</body>
<script>
    function fy(pageNum) {
        $("[name='pageNum']").val(pageNum)
        $("form").submit()
    }
    function addTo() {
        location="addTo.do";
    }
</script>
</html>
